﻿@namespace SwashbucklerDiary.Rcl.Components
@inherits CardListComponentBase<LocationModel>

<div class="card-list-wrap">
    <div class="card-list-main">
        <CascadingValue Value="this"
                        IsFixed="true">
            <Virtualize Items="Value"
                        ItemSize="60"
                        Context="item">
                <LocationCard @key="item.Id"
                              Value="item"
                              OnMenu="OpenMenu">
                </LocationCard>
            </Virtualize>
        </CascadingValue>
    </div>

    @if (Value.Count > 0 && showStatisticsCard)
    {
        <MultiDisplay MdAndUp="true">
            <DesktopContent>
                <div class="card-list-assist-info">
                    <LocationStatisticsCard Value="Value">
                    </LocationStatisticsCard>
                </div>
            </DesktopContent>
        </MultiDisplay>
    }
</div>

<EmptyResult Show="Value.Count == 0"
             Text="@(I18n.T("Location.NoLocation"))">
</EmptyResult>

<InputDialog @bind-Visible="ShowRename"
             Text="@(SelectedItemValue.Name)"
             Title="@(I18n.T("Location.Rename"))"
             Placeholder="@(I18n.T("Location.Placeholder"))"
             MaxLength="50"
             OnOK="ConfirmRename">
</InputDialog>

<DeleteDialog @bind-Visible="ShowDelete"
              Title="@(I18n.T("Location.Delete.Title"))"
              Content="@(I18n.T("Location.Delete.Content"))"
              OnOK="ConfirmDelete">
</DeleteDialog>

<RadioDialog @bind-Value="sortItem"
             @bind-Visible="showSort"
             OnChange="SortChanged"
             TItem="string"
             TItemValue="string"
             Title="@(I18n.T("Share.Sort"))"
             Items="SortItems">
</RadioDialog>

<MultiMenu @ref="multiMenu"
           @bind-Visible="ShowMenu"
           DynamicListItems="menuItems">
</MultiMenu>
